<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tk="http://www.qdocuments.net" exclude-result-prefixes="tk">
  <xsl:import href="Utility.xslt"/>
  <xsl:variable name="tk:TreeID" select="$tk:Toolkit/_TREE_FIELDS/ID"/>
  <xsl:variable name="tk:TreeParentID" select="$tk:Toolkit/_TREE_FIELDS/PARENTID"/>
  <xsl:variable name="tk:TreeName" select="$tk:Toolkit/_TREE_FIELDS/NAME"/>
  <xsl:variable name="tk:TreeLeaf" select="$tk:Toolkit/_TREE_FIELDS/ISLEAF"/>
  <xsl:template match="*" mode="tk:TreeNode">
    <xsl:variable name="ID" select="*[local-name()=$tk:TreeID]"/>
    <xsl:variable name="Name" select="*[local-name()=$tk:TreeName]"/>
    <xsl:variable name="ParentID" select="*[local-name()=$tk:TreeParentID]"/>
    <xsl:variable name="TreeLeaf" select="*[local-name()=$tk:TreeLeaf]"/>
    <xsl:variable name="NameHref">ShowDetail('<xsl:value-of select="$ID"/>', '<xsl:value-of select="$ParentID"/>', 'Detail');</xsl:variable>
    <tr>
      <td colspan="11">
        <xsl:choose>
          <xsl:when test="$TreeLeaf = '0'">
            <xsl:variable name="ClickHref">GetChildSX('<xsl:value-of select="$ID"/>','CODE_<xsl:value-of select="$ID"/>','','../Library/WebTreeXmlPage.<xsl:value-of select="$tk:PageX"/>?Source=<xsl:value-of select="$tk:Source"/>','Child');</xsl:variable>
            <img src="../images/plus.gif" border="0" style="cursor:hand" id="{concat('Button_',$ID)}" onclick="{$ClickHref}"/>
          </xsl:when>
          <xsl:otherwise>
            <img src="../images/bullet.gif" border="0"/>
          </xsl:otherwise>
        </xsl:choose>
        <a href="javascript:{$NameHref}" onclick="">
          <xsl:value-of select="$Name"/>
        </a>
      </td>
    </tr>
    <input type="hidden" id="{concat('hdExpand_', $ID)}" value="false"/>
    <tr style="display:none" id="{concat('Expand_', $ID)}">
      <td>
        <img src="../images/empty.gif" border="0" width="6" height="0"/>
      </td>
      <td colspan="10">
        <div>
          <table border="0" cellpadding="0" cellspacing="0" width="100%" id="{concat('CODE_', $ID)}">
            <tr>
              <td height="0"/>
            </tr>
          </table>
        </div>
      </td>
    </tr>
  </xsl:template>
</xsl:stylesheet>
